package com.jcj.jcjmq.model;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
@AllArgsConstructor
public class Result<T> {
    private Integer code;
    private T data;

    public static Result<String> ok() {
        return new Result<>(1, "OK");
    }

    public static Result<String> ok(String msg) {
        return new Result<>(1, msg);
    }

    public static Result<Message> msg(Message<?> recv) {
        return new Result<>(1, recv);
    }

    public static Result<List<Message<?>>> msg(List<Message<?>> recv) {
        return new Result<>(1, recv);
    }


}
